package blueBridgeCup;

import java.util.Scanner;

public class demo4 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int x=in.nextInt();
        int[]arr=new int[x];
        for (int i = 0; i <x ; i++) {
            arr[i]= in.nextInt();
            System.out.print(arr[i]);
        }
        System.out.println();
        for (int i = x-1; i >=0; i--) {
            System.out.print(arr[i]);
        }
    }
}
